import React, { Component } from "react";
import "@wangeditor/editor/dist/css/style.css";
import { Editor, Toolbar } from "@wangeditor/editor-for-react";
export default class RichEditor extends Component {
  handleChange = (editor) => {
    // console.log(editor);
    // console.log(editor.getHtml());
    let html = editor.getHtml();
    this.props.onChange(html);
  };
  render() {
    return (
      <>
        <Toolbar />
        <Editor
          style={{ height: "300px", border: "1px solid #d8d8d8" }}
          onChange={this.handleChange}
        />
      </>
    );
  }
}
